def my_pow(x, n):
    if n < 0:
        x = 1 / x
        n = -n
    if n == 0:
        return 1
    if n % 2 == 0:
        return my_pow(x * x, n / 2)
    else:
        return my_pow(x * x, n // 2) * x
